// ------------------------------------------------集中管理路由-------------------------------------------------
// 一级：布局组件
import Layout from '../views/layout.vue'
// ------------二级：首页
import Index from '../views/home/index.vue'
// ------------二级：问答
const Question = () => import('@/views/question/index.vue')
// ------------二级：视频
const Video = () => import('@/views/video/index.vue')
// ------------二级：个人中心
const Profile = () => import('@/views/profile/index.vue')
// 一级：编辑资料
const Edit = () => import('@/views/user/edit.vue')
// 一级：小智同学
const Chat = () => import('@/views/user/chat.vue')
// 一级：登陆
const Login = () => import('@/views/login/login.vue')
// 一级：搜索中心
const Search = () => import('@/views/search/index.vue')
// 一级：搜索结果
const Result = () => import('@/views/search/result.vue')
// 一级：文章
const Article = () => import('@/views/article/index.vue')

// 路由配置
export default [
  {
    path: '/',
    // 布局
    component: Layout,
    children: [
      // 二级路由
      {
        path: '/',
        name: 'home-index',
        // 首页
        component: Index
      },
      {
        path: '/question',
        name: 'question-index',
        // 问答
        component: Question
      },
      {
        path: '/video',
        name: 'video-index',
        // 视频
        component: Video
      },
      {
        path: '/user',
        name: 'user-index',
        // 个人中心
        component: Profile
      }
    ]
  },
  {
    path: '/user/profile',
    name: 'user-profile',
    // 编辑资料
    component: Edit
  }, {
    path: '/user/chat',
    name: 'chat-index',
    // 小智同学
    component: Chat
  },
  {
    path: '/login',
    name: 'login-index',
    // 登陆
    component: Login
  }, {
    path: '/search',
    name: 'search-index',
    // 搜索
    component: Search
  },
  {
    path: '/search/result',
    name: 'result-index',
    // 搜索结果
    component: Result
  }, {
    path: '/article/:id',
    name: 'article-index',
    // 文章详情
    component: Article
  }
]
